package com.zhny.sensor.dao;

import com.zhny.sensor.entity.BarcodeMachineStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @Auther: zhy
 * @Date: 2019/11/23
 * @Description: 脚标机状态管理
 */
public interface BarcodeMachineStatusRepository extends JpaRepository<BarcodeMachineStatus,String> {

    @Modifying
    @Query("update BarcodeMachineStatus b set b.state = ?1,b.barcodeSurplus = ?2 where b.barcodeMachineId = ?3")
    int updateBarcodeMachineStatus(String state, Integer barcodeSurplus, String barcodeMachineId);

}
